//
// Created by fanghr on 18-3-30.
//

#ifndef NEF_BACKEND_THREAD_GESTREC_H
#define NEF_BACKEND_THREAD_GESTREC_H

#include <opencv2/opencv.hpp>
#include <pthread.h>
#include "../../camsrv/gestrecn/include/gestrec.h"
#include "thread_mat.h"

class thread_gestrec {
public:
    thread_mat &r;
    thread_mat &l;

    enum result_t {
        FIST = 0,
        ONE_FINGER,
        TWO_FINGER,
        THREE_FINGER,
        FOUR_FINGER,
        FIVE_FINGER,
        UNKNOWN,
    } result;

    bool is_gestrec_already, is_run;

    pthread_t thread;
    pthread_rwlock_t rwlock;

    thread_gestrec(thread_mat &r_mat, thread_mat &l_mat);

    ~thread_gestrec();

    int run();

    int stop();
};

#endif //NEF_BACKEND_THREAD_GESTREC_H
